package homework03;

/**
 * 上网套餐类 特征：上网流量、每月资费 行为：显示所有套餐信息
 */
public class Internet extends SetMeal implements InternetInterface {
    private int flow;       //上网流量

    public int getFlow() {
        return flow;
    }

    public void setFlow(int flow) {
        this.flow = flow;
    }


    @Override
    public void surf(int flow, SimType simType) {
        System.out.println("流量使用：" + flow + "M,卡类型是：" + simType.getDesc());
    }

    @Override
    public void show(SimType simType) {
        switch (simType) {
            case BIG_SIM:
                setCost(15);
                setFlow(1024);
                System.out.println("上网流量套餐：" + getFlow() + "M，每月资费：" + getCost() + "元");
                break;
            case SMALL_SIM:
                setCost(10);
                setFlow(512);
                System.out.println("上网流量套餐：" + getFlow() + "M，每月资费：" + getCost() + "元");
                break;
            case MINI_SIM:
                setCost(5);
                setFlow(256);
                System.out.println("上网流量套餐：" + getFlow() + "M，每月资费：" + getCost() + "元");
                break;
            default:
                System.out.println("没有此卡类型。。。");
        }

    }
}
